home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 21 / PC Format CD-ROM Collection 21 (1995-12)(Future Publishing)(GB)[issue 51].iso / resource / stddef.h < prev    next >
C/C++ Source or Header  |  1990-11-25  |  810b  |  26 lines

  1. /*****************************************************************************
  2.  * STDDEF.H        Standard type definitions.
  3.  *
  4.  *                Note a little strangeness in the offsetof() macro...We have
  5.  *                to use a cast of NULL rather than the typical cast of 0, and
  6.  *                we have to subtract the resulting member pointer from NULL.
  7.  *                All of this is because Poco won't allow pointer/number casts.
  8.  *
  9.  * 11/22/90        Created for Poco.
  10.  ****************************************************************************/
  11.  
  12. #ifndef STDDEF_H
  13. #define STDDEF_H
  14.  
  15. #ifndef __POCO__
  16. #error This STDDEF.H file is for use with Poco C only!
  17. #endif
  18.  
  19. typedef long     ptrdiff_t;
  20. typedef long    size_t;
  21. typedef char     wchar_t;
  22.  
  23. #define offsetof(struc, mbr)  (size_t)( (char *)(&(((struc *)NULL)->mbr))-(char *)NULL )
  24.  
  25. #endif
  26.